import 'package:flutter/material.dart';
import 'package:nft_shop/my/model/models.dart';
import 'package:nft_shop/res/global.dart';
import 'package:nft_shop/widgets/my_app_bar.dart';
import 'package:nft_shop/widgets/my_scroll_view.dart';

class MyWalletDetailsPage extends StatefulWidget {
  BillListModel model;
  MyWalletDetailsPage({Key? key,required this.model}) : super(key: key);

  @override
  _MyWalletDetailsPageState createState() => _MyWalletDetailsPageState();
}

class _MyWalletDetailsPageState extends State<MyWalletDetailsPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: MyAppBar(
        centerTitle: "收支详情",
      ),
      body: MyScrollView(
        children: [
          _buildTopView(),
          Container(height: 5,color: Color(0xFFF5F5F5),),
          _buildTextView("类型",widget.model.billTypePid == 1?"收入":"支出"),
          _buildTextView("时间",widget.model.createTime??""),
          _buildTextView("余额",widget.model.moneyProof??"0.00"),
          _buildTextView("订单号",widget.model.orderNum??""),
        ],
      ),
    );
  }
  //topview
  _buildTopView(){
    return Container(
      height: 137,
      child: Column(
        children: [
          SizedBox(height: 30,),
          Center(child: Text(widget.model.title??"",style: TextStyle(fontSize: 14,color: Global.kTheme.inputHint1,fontFamily: Global.mySemiboldFont),)),
          SizedBox(height: 18,),
          Center(child: Text(widget.model.turnover??"0.00",style: TextStyle(fontSize: 30,color: Global.kTheme.textPrimary1,fontFamily: Global.myDINFont),)),
        ],
      ),
    );
  }

  //TextContent
  _buildTextView(String left,String right){
    return Container(
      padding: EdgeInsets.only(left: 20,right: 20,top: 13,bottom: 18),
      decoration: BoxDecoration(
          border: Border(
            bottom: Divider.createBorderSide(context, color: Color(0xFFF8F8F8), width: 1),
          )
      ),
      child: Row(
        children: [
          Text(left,style: TextStyle(fontSize: 12,color: Global.kTheme.inputHint1,),),
          Spacer(),
          Text(right,style: TextStyle(fontSize: 12,color: Global.kTheme.textPrimary1,fontFamily: Global.myDINFont),),
        ],
      ),
    );
  }
}
